package com.czg.designmode.singleton;

/**
 * 双重锁机制-线程安全
 *
 * @author chenzhigang
 */
public class DoubleLockSingleton {

    private volatile static DoubleLockSingleton doubleLockSingleton;

    public static DoubleLockSingleton getInstance() {
        if (null == doubleLockSingleton) {
            synchronized (DoubleLockSingleton.class) {
                if (null == doubleLockSingleton) {
                    doubleLockSingleton = new DoubleLockSingleton();
                }
            }
        }
        return doubleLockSingleton;
    }

}
